package com.hdu.pyl.model;

public enum ResultEnum {
    SUCCESS(1,"success"),
    FAIL(0,"fail")
    ;
    private int state;
    private String info;
    private ResultEnum(int state,String info){
        this.state=state;
        this.info=info;
    }
    public static String getInfo(int state){
        for (ResultEnum e:ResultEnum.values()
             ) {
            if (e.state==state){
                return e.info;
            }
        }
        return null;
    }
    public int getState(){
        return state;
    }
    public String getInfo(){
        return info;
    }
}
